<?php /*a:1:{s:90:"E:\website\phpstudy_pro\WWW\think\tpadmin\tp51Admin\application\admin\view\role\index.html";i:1600351369;}*/ ?>
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]>
    <script type="text/javascript" src="/static/lib/html5shiv.js"></script>
    <script type="text/javascript" src="/static/lib/respond.min.js"></script>
    <![endif]-->
    <link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="/static/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />
    <!--[if IE 6]>
    <script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <![endif]-->
    <title>角色列表</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 主面板 <span class="c-gray en">&gt;</span> 后台用户 <span class="c-gray en">&gt;</span> 角色管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <div class="text-l">
        <form action="" method="get">
            <input type="text" class="input-text" style="width:180px" placeholder="角色名称" name="role_name">
            <button type="submit" class="btn btn-success" name=""><i class="Hui-iconfont">&#xe665;</i> 查询</button>
        </form>
    </div>
    <div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l">
        <a href="<?php echo url('admin/role/add'); ?>"  class="btn btn-primary radius"><i class="Hui-iconfont Hui-iconfont-add2"></i> 添加</a></span> <span class="r">共有数据：<strong><?php echo htmlentities($total); ?></strong> 条</span>
    </div>
    <table class="table table-border table-bordered table-bg">
        <thead>
        <tr class="text-c">
            <th width="25"><input type="checkbox" name="" value=""></th>
            <th width="40">ID</th>
            <th width="200">角色名称</th>
            <th>备注</th>
            <th width="130">创建时间</th>
            <th width="150">操作</th>
        </tr>
        </thead>
        <tbody>

        <?php if(is_array($list) || $list instanceof \think\Collection || $list instanceof \think\Paginator): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$item): $mod = ($i % 2 );++$i;?>
        <tr class="text-c">
            <td><input type="checkbox" value="1" name=""></td>
            <td><?php echo htmlentities($item['role_id']); ?></td>
            <td><?php echo htmlentities($item['role_name']); ?></td>
            <td><?php echo htmlentities($item['remark']); ?></td>
            <td><?php echo date('Y/m/d H:i:s',$item['create_time']); ?></td>
            <td class="td-manage">
                <?php if($item['role_id'] > 1): ?>
                <a href="javascript:;" onclick="setRolePermission('设置权限','<?php echo url('admin/role/setRolePermission'); ?>?role_id=<?php echo htmlentities($item['role_id']); ?>',1000,700)"><i class="Hui-iconfont Hui-iconfont-manage"></i>设置权限</a>
                <?php endif; ?>
                <a title="编辑" href="<?php echo url('admin/role/edit'); ?>?role_id=<?php echo htmlentities($item['role_id']); ?>" class="ml-5"><i class="Hui-iconfont Hui-iconfont-edit2"></i>编辑</a>
                <a title="删除" href="javascript:;" onclick="role_del(this,'<?php echo url('/admin/role/del'); ?>'+'?role_id=<?php echo htmlentities($item['role_id']); ?>')" class="ml-5"><i class="Hui-iconfont Hui-iconfont-del2"></i>删除</a>
            </td>
        </tr>
        <?php endforeach; endif; else: echo "" ;endif; ?>

        </tbody>
    </table>

    <div class="cl pd-5 mt-20">
        <div class="l"></div>
        <div class="r">
            <?php echo $list; ?>
        </div>
    </div>


</div>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/static/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/static/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript">

    //角色删除
    function role_del(obj, uri){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                type: 'GET',
                url: uri,
                dataType: 'json',
                success: function(data){
                    if(data.err==0) {
                        $(obj).parents("tr").remove();
                        layer.msg(data.msg, {icon: 1, time: 2000});
                        return true;
                    } else {
                        layer.msg(data.msg, {icon: 2, time: 3000});
                        return false;
                    }
                },
                error:function(data) {
                    console.log(data.msg);
                },
            });
        });
    }

    // 设置权限
    function setRolePermission(title, url, width, height)
    {

        layer_show(title, url, width, height);
    }


</script>
</body>
</html>